// BWStitchSelection -- collection of selected stitches

#import <Cocoa/Cocoa.h>

@class BWStitch;
@class BWStitchArray;

@interface BWStitchSelection : NSObject
{
    NSMutableSet *selectedStitches;
    BWStitchArray *stitches;
}

- (void) setStitches: (BWStitchArray *) stitches;

- (BOOL) isStitchSelected: (BWStitch *) stitch;

- (void) selectAll;
- (void) unselectAll;

- (void) selectStitch: (BWStitch *) stitch
    unselectingOthers: (BOOL) unselectOthers;

- (void) unselectStitch: (BWStitch *) stitch;

- (int) count;

- (NSIndexSet *) indexesForSelection;

- (NSEnumerator *) objectEnumerator;

// so we can hook up KVO
- (void) setStitches: (BWStitchArray *) stitches;

// if the selection count is 1, this will be the selected stitch
- (BWStitch *) arbitraryStitch;

// !!! scaffolding
- (BWStitch *) selectedStitch;

@end // BWStitchSelection

